#!/usr/bin/env python
# -*- coding: iso-8859-1 -*-

import sys, os

def build(bld):
    bld.recurse('runtime memAnalyzer')

    uselib_custom = ''
    if sys.platform == 'cygwin':
        uselib_custom = ' WINSOCK'

    bld(features='cxx cxxstlib',
            target = 'trap',
            use = 'syscall tools debugger utils profiler objcodeFrontend BOOST_THREAD BOOST_REGEX BOOST_FILESYSTEM BOOST_SYSTEM ELF_LIB SYSTEMC' + uselib_custom,
            install_path = os.path.join(bld.env.PREFIX, 'lib')
    )

    if bld.env['ENABLE_SHARED_64']:
        bld(features='cxx cxxshlib',
                target = 'trap',
                use = 'syscall tools debugger utils profiler objcodeFrontend BOOST_THREAD BOOST_REGEX BOOST_FILESYSTEM BOOST_SYSTEM ELF_LIB SYSTEMC' + uselib_custom,
                install_path = os.path.join(bld.env.PREFIX, 'lib')
        )

    bld(features='py', source=bld.path.ant_glob('*.py'), install_path = os.path.join(bld.env.PYTHONDIR, 'trap'))
